<?php

use Hyperf\Database\Migrations\Migration;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Schema\Schema;

class CreateRolesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('roles');
        Schema::create('roles', function (Blueprint $table) {

            $table->id();
            $table->string('role_name')->default('')->unique()->comment('名称');
            $table->tinyInteger('state')->default('1')->comment('1 展示 2隐藏');
            $table->string('role_en')->default('')->comment('管理员英文标识');
            $table->timestamps();
            $table->softDeletes();
            $table->comment('角色');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('roles', function (Blueprint $table) {
            //
        });
    }
}
